package com.hk.core.security.cas.oauth2;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Data
@ConfigurationProperties(prefix = "hk.cas.oauth2")
public class CasOauth2Properties {

    private String casServerBaseUrl;

    private String clientId;

    private String clientSecret;

    private String casServerTokenSuffixUrl = "/oauth2.2/token";

    private String casServerRefreshTokenSuffixUrl = casServerTokenSuffixUrl;

    private String casServerProfileParamName = "token";

    private String casServerProfileSuffixUrl = "/oauth2.0/profile";

    public String getCasServerTokenUrl() {
        return getCasServerBaseUrl().concat(getCasServerTokenSuffixUrl());
    }

    public String getCasServerRefreshTokenUrl() {
        return getCasServerBaseUrl().concat(getCasServerRefreshTokenSuffixUrl());
    }

    public String getCasServerProfileUrl() {
        return getCasServerBaseUrl().concat(getCasServerProfileSuffixUrl());
    }

}
